package close;
/**
 * implement a calculator with encapsulation, inheritance, polymorphism
 * @author wangjxin
 *
 */
public class Operation {
	public   double getResults(double numberA, double numberB) {
		return 0;
	}
	
	public static void main(String[] args){
		Operation plus_operation = OperationFactory.getOperation(Operations.plus);
		System.out.println(plus_operation.getResults(12313, 134334));
	}
}

class Operation_plus extends Operation{
	public double getResults(double numberA, double numberB) {
		double result = numberA + numberB; 
		return result;
	}
}

 enum Operations {
	plus,minus,multiple,except
 }
 
class OperationFactory{
	 static Operation getOperation(Operations operate){
		
		switch(operate){
		case plus:return new Operation_plus();
		}
		return null;
	}
}